package com.sendi.sql;

import java.util.Date;

/*
 * 记录取得最大值的结果
 */
public class MaxResult {

	/*
	 * type类型决定最大值的数据类型
	 * 目前支持INT,LONG,DOUBLE,FLOAT,DATE
	 */
	public String type="";
	public int maxint=0;
	public long maxlong=0l;
	public float maxfloat=0.0f;
	public Date maxdate=null;
	public double maxdouble=0.0d;
	public int maxindex=0;
	
	public Object getMaxResult()
	{
		Object o=null;
		if(type.equalsIgnoreCase("INT"))
		{
			o=maxint;
		}
		else if(type.equalsIgnoreCase("LONG"))
		{
		 o=maxlong;
		}
		else if(type.equalsIgnoreCase("FLOAT"))
		{
			o=maxfloat;
		}
		else if(type.equalsIgnoreCase("DOUBLE"))
		{
			 o=maxdouble;
		}
		else if(type.equalsIgnoreCase("DATE"))
		{
			 o=maxdate;
		}
		return o;
	}
}
